/**
 * Copyright (C) 2013-2014 the original author or authors.
 */
package com.foreveross.bsl.mam.rbac.application;

import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.foreveross.bsl.common.utils.web.QuerySpecs;
import com.foreveross.bsl.mam.rbac.application.vo.RoleVO;

/**
 * <BR>
 * [功能详细描述]
 * 
 * @author Amberlo
 * @version [mam-application , 2013-6-26]
 */
@Path(value = "/role")
@Produces(MediaType.APPLICATION_JSON)
public interface RoleApplication {
	@POST
	@Path("/add")
	public RoleVO saveEntity(RoleVO entity);
 
	@POST
	@Path("/update")
	public RoleVO updateEntity(RoleVO entity);

	@POST
	@Path("/delete")
	public void deleteEntity(RoleVO entity);

	@GET
	@Path("/get/{id}")
	public RoleVO getEntity(@PathParam("id") String id);

	@GET
	@Path("/all")
	public List<RoleVO> findAll();

	@POST
	@Path("/findAll")
	@Consumes(MediaType.APPLICATION_JSON)
	public Page<RoleVO> findByPageable(Pageable pageable);

	@GET
	@Path("/findByRoleName")
	public RoleVO getRoleByRoleName(@QueryParam("roleName") String roleName);

	@GET
	@Path("/findByName")
	public RoleVO getRoleByName(@QueryParam("name") String name);

	@GET
	@Path("find/{page}/{size}")
	public Page<RoleVO> findRolesBySpec(@PathParam("page") int pageNumber, @PathParam("size") int pageSize,
			@QueryParam("q") QuerySpecs querySpecs);
}
